-
Notifications
You must be signed in to change notification settings - Fork 462
ios: support additional options pass from js #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello, does this features are possible on android? I haven't checked. |
I checked the connection service API and looks like there is nothing to control that. options looks like generic, but what we want to do with android with this options? Does options need to be renamed to be more ios specific? Can you add the documentation on the README? |
Yes, on android, currently is no-op to the options. About the naming, I just left it as it's original name of iOS because in the original api I could change the name in the options with Maybe we could change to like this? let options = {
ios: {
hasVideo: true,
supportsHolding: true,
supportsDTMF: true,
supportsGrouping: true,
supportsUngrouping: true,
}
} Because this PR related to api definition and slightly breaking change, so I will add document once we are all agreed the final api and this PR then :) |
I think thats valid @zxcpoiu - its really difficult to merge everything into a combined API, I have partial video support going in Android but it really needs more work before I do a PR but we could just have an android key in the object - android doesnt support "supportsDTMF" for example... "supportsHolding" is done by capability flags passed into various things in connection service |
Hello, i prefer this approach @zxcpoiu. |
…comingCall. Which is usefull if you want to tell the pushkit you handled the VoIP notification only after the call was successfully reported.
To confirm, we are saying that we prefer below approach, right? let options = {
ios: {
hasVideo: true,
supportsHolding: true,
supportsDTMF: true,
supportsGrouping: true,
supportsUngrouping: true,
}
} |
I am. We just can't hide the intrinsic differences between the platform's completely - android actually has a load more functionality not yet exposed! |
Yes, i also confirm, thank you. |
@zxcpoiu can you rebase on master please ? |
…er, so it is not a breaking change.
bfac182
to
24a1e9c
Compare
Done!
If you want the api to be unified, I'm happy to move Let me know if anything need to change. |
…ommits this is my first time doing this
…ommits this is my first time doing this
…-native Separate react native part from rest of Android code
@zxcpoiu can you rebase it please ? So we can merge it. |
…ack_to_foreground_killed [Android] BackToForeground when app is killed.
@zxcpoiu can you rebase your PR ? Thanks ! |
answerIncomingCall is missing from the index.d.ts file
Update index.d.ts
…evert_wakeup_app Android: Revert wakeUpApplication to use react-native class
sorry for the delay, rebased. |
But I noticed this PR needs to be discussed about the overloading api Due to the addition of Main functioonmain function should contains all arguments + (void)reportNewIncomingCall:(NSString *)uuidString
handle:(NSString *)handle
handleType:(NSString *)handleType
hasVideo:(BOOL)hasVideo
localizedCallerName:(NSString * _Nullable)localizedCallerName
fromPushKit:(BOOL)fromPushKit
payload:(NSDictionary * _Nullable)payload
withCompletionHandler:(void (^_Nullable)(void))completion
{ Overloading 1When we was adding + (void)reportNewIncomingCall:(NSString *)uuidString
handle:(NSString *)handle
handleType:(NSString *)handleType
hasVideo:(BOOL)hasVideo
localizedCallerName:(NSString * _Nullable)localizedCallerName
fromPushKit:(BOOL)fromPushKit
{ Overloading 2When we was adding + (void)reportNewIncomingCall:(NSString *)uuidString
handle:(NSString *)handle
handleType:(NSString *)handleType
hasVideo:(BOOL)hasVideo
localizedCallerName:(NSString * _Nullable)localizedCallerName
fromPushKit:(BOOL)fromPushKit
payload:(NSDictionary * _Nullable)payload
{ |
Main function should have all arguments for sure:+ (void)reportNewIncomingCall:(NSString *)uuidString
handle:(NSString *)handle
handleType:(NSString *)handleType
hasVideo:(BOOL)hasVideo
localizedCallerName:(NSString * _Nullable)localizedCallerName
supportsHolding:(BOOL)supportsHolding
supportsDTMF:(BOOL)supportsDTMF
supportsGrouping:(BOOL)supportsGrouping
supportsUngrouping:(BOOL)supportsUngrouping
fromPushKit:(BOOL)fromPushKit
payload:(NSDictionary * _Nullable)payload
withCompletionHandler:(void (^_Nullable)(void))completion
{ So now we have to decide:
|
Hello @zxcpoiu, yes ! you right we need to cleanup a little that. We could probably release a new major version with some new features like #237 and #188 and removing some old backward compatibilities if there is no strong objection here. I think with these two PRs we have some interesting works to have video capabilities in callkeep for android and iOS. |
The commit history is getting funky on github, not sure why. force push and delete branch does't fix it. |
Support addition options can pass from js method
updateDisplay
original:
updateDisplay = (uuid, displayName, handle)
new:
updateDisplay = (uuid, displayName, handle, options = null)
where the optional options could be:
displayIncomingCall
original:
displayIncomingCall = (uuid, handle, localizedCallerName, handleType = 'number', hasVideo = false)
new:
displayIncomingCall = (uuid, handle, localizedCallerName, handleType = 'number', hasVideo = false, options = null)
where the optional options could be:
Note for API compatibility:
Originally,
displayIncomingCall
already hashasVideo
argument butupdateDisplay
are not. For api compatibility, I did NOT movedisplayIncomingCall.hasVideo
insidedisplayIncomingCall.options
In the earlier time, we've exposed native
reportNewIncomingCall
and introduced an overloading function for the newpayload
argument for api compatibility:Earlier Original (as simple api):
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
and
Earlier New (as full api):
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES payload:extra];
We can't have too much overloading functions, so I keep the original one, and extend the new overloading function, so now is:
This PR Original (as simple api):
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
and
This PR New (as full api):
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName supportsHolding: YES supportsDTMF: YES supportsGrouping: YES supportsUngrouping: YES fromPushKit: YES payload: payload];
TL;DR
For user using native
RNCallKeep reportNewIncomingCall
withpayload
argument should change to[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName supportsHolding: YES supportsDTMF: YES supportsGrouping: YES supportsUngrouping: YES fromPushKit: YES payload: payload];